import 'package:json_annotation/json_annotation.dart';

part 'personalMessages.g.dart';

@JsonSerializable(explicitToJson: true)
class PersonalMessages {
  List<PersonalMessage> messages;

  PersonalMessages(this.messages);

  factory PersonalMessages.fromJson(Map<String, dynamic> json) =>
      _$PersonalMessagesFromJson(json);

  Map<String, dynamic> toJson() => _$PersonalMessagesToJson(this);
}

@JsonSerializable(explicitToJson: true)
class PersonalMessage {
  int sender_id;
  int receiver_id;
  String message;
  int time;

  PersonalMessage(this.sender_id, this.receiver_id, this.message, this.time);

  factory PersonalMessage.fromJson(Map<String, dynamic> json) =>
      _$PersonalMessageFromJson(json);

  Map<String, dynamic> toJson() => _$PersonalMessageToJson(this);
}
